<template>
  <div class="list">
    <div v-for="(item, index) in categoryList" :key="index">
      <div class="item">
        <i class="icon"></i>
        <span>{{item.title}}</span>
      </div>
      <div class="item-children" v-if="item.children">
        <detail-list :categoryList="item.children"></detail-list>
      </div>
    </div>
  </div>
</template>
<script>
import DetailList from "./List";
export default {
  name: "DetailList",
  components: {
    DetailList
  },
  props: {
    categoryList: {
      type: Array
    }
  }
};
</script>
<style lang="scss" scoped>
@import "~@/assets/style/global.scss";
.item{
  @include flexCenter;
  border-bottom:1px solid #eee;
  height: 80px;
  padding-left: 20px;

}
.icon {
  display: block;
  width: 50px;
  height: 50px;
  background: url("~@/assets/img/icon.png") no-repeat;
  background-position-x: 0.8vw;
  background-position-y: -7.067vw;
  background-size: 50px;
}
.item-children{
  padding-left: 50px;
}
</style>
